<template>
    <div>
        <h3>当前的count值为：{{ count }}</h3>
        <button @click="sub">-1</button>
        <h4>{{ showCount }}</h4>
    </div>
</template>
<script>
import {mapState,mapMutations,mapGetters} from 'vuex'
export default {
    data(){
        return {

        }
    },
    computed:{
        ...mapState(['count']),
        ...mapGetters(['showCount'])
    },
    methods:{
        ...mapMutations(['sub'])
    }
}
</script>
<style lang="less" scoped>

</style>